﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.CompanyListModels>" %>
<div class="bor_cor mar_t" style="background-color:#FFFFE5">
   <div class="bar_org"><a href="#"><%=ViewData["Title"] %></a></div>

   <div class="new_point">
    	 <marquee height="280" behavior="scroll" align="center" direction="up" scrollamount="3" scrolldelay="100" onmouseover="this.stop()" onmouseout="this.start()">
    	<ul>
        	<% var index = 0;
        	    foreach (var item in Model.Companies)
                {
                    var css = index % 2 == 0 ? string.Empty : "bg_gray";
                    if (index == Model.Companies.Count - 1)
                    {
                        css = css + " bor_none";
                    }                    
                    index += 1;
                    string imgPath = (item.ImagePath != null && item.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(item.ID, 62, 55, item.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo;
                    %>
        	<li class="<%=css %>">
            	<%var link = item.Website != null && item.Website != string.Empty ? item.Website : "/company/more/" + item.ID;
               if (item.Website!=null && item.Website!=string.Empty)
               {
                   var httpindex = link.ToLower().IndexOf("http://");
                   if (httpindex < 0) {
                       link = "http://" + item.Website;
                   }
               } %>
            	<div class="new_point_img"><a href="<%=link %>" target="_blank"><img src="<%=imgPath %>" width="62" height="55" class="bor_img" /></a></div>
                <div class="new_point_txt"><a href="<%=link %>" class="link_gray" target="_blank"><%=Html.Encode(item.Name) %></a></div>
                <div class="clear"></div>
            </li>
            <%} %>
        </ul>
        </marquee>
  </div>
</div>